package com.xyrl.third.aliyun.configuration;

import com.xyrl.third.aliyun.config.AliYunProperties;
import com.xyrl.third.aliyun.service.SingleCallService;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
/**
 * 语音电话工具类
 *
 * @className SingleCallAutoConfiguration
 * @company 星纭融链科技服务有限公司
 * @author zhongp
 * @version 1.0
 * @date 2020-01-02 17:25:13
 * @Description
 */
@Configuration
@ConditionalOnClass(SingleCallService.class)
@EnableConfigurationProperties(AliYunProperties.class)
public class SingleCallAutoConfiguration {

    @Bean
    @ConditionalOnMissingBean(SingleCallService.class)
    public SingleCallService aliyunSingleCallService() {
        SingleCallService singleCallService = new SingleCallService();
        // 如果提供了其他set方法，在此也可以调用对应方法对其进行相应的设置或初始化。
        return singleCallService;
    }
}
